package com.example.zyy.weather_zyy_35.View.activity;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;

import com.example.zyy.weather_zyy_35.R;

public class MainActivity extends AppCompatActivity {
    public Button button;
    public TextView tv;
    public int num=0;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Toast.makeText(this,"Start!",Toast.LENGTH_LONG).show();
        button=findViewById(R.id.btn);
        tv=findViewById(R.id.tv);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(MainActivity.this, "Button clicked!2222", Toast.LENGTH_LONG).show();
                num += 1;
                tv.setText("clicked:" + num);
            }
        });
    }
}
